package com.geekaca.d4.d5boxing;

public class TestBoxing {
    public static void main(String[] args) {

        Integer myInt = new Integer(5);
        System.out.println(myInt);

        Integer theInt = 99; //自动装箱

        int myAge = theInt; //自动折箱

        theInt = null;
//        myAge=null;
//        int age = theInt; //空指针异常

        Integer height = new Integer(99);
        int iHeight = height.intValue();

        // Integer -> String ->
        String strHeight = height.toString();
        System.out.println("字符串类型: " + strHeight);

        //Integer->String ->
        String strHt = height + "";
        //String  -> Integer


        String count2 = "2";
        Integer.parseInt(count2);

        Double d = Double.valueOf(9.8);
        System.out.println(d);
        System.out.println(d.doubleValue());

    }
}
